import moment from "moment"
moment.locale("zh-cn")
let filter = {};
filter.install = function (Vue) {
    Vue.filter("timer", (v, type = "YYYY/MM/DD hh:mm:ss") => {
        return moment(v * 1000).format(type);
    })
    Vue.filter("level", (v) => {
        switch (v) {
            case 0:
                return "一级"
            case 1:
                return "二级"
            case 2:
                return "三级"
                default :
                return "一级"
        }
    })
    Vue.filter("color", (v) => {
        switch (v) {
            case 0:
                return ""
            case 1:
                return "success"
            case 2:
                return "warning"
            default:
                return ""
        }
    })
}
export default filter